import {
	Request
} from './request.js'

class HttpApi extends Request {
	/* 登录接口 */
	Login(telphone, verifyCode) {
		return this.getData({
			url: '/user/login',
			method: "POST",
			data: {
				telphone: telphone,
				verifyCode: verifyCode
			}
		})
	}
	/* 发送验证码 */
	SendCode(telphone) {
		return this.getData({
			url: '/sms/send',
			method: "POST",
			data: {
				telphone: telphone
			}
		})
	}

	/* 首页推荐婚车 */
	CarRecommend(cityId, recommendPlace) {
		return this.getData({
			url: '/car/car/recommend/list',
			method: "POST",
			data: {
				cityId: cityId,
				recommendPlace: recommendPlace
			}
		})
	}

	/* 首页推荐婚车套餐 */
	CarRecommendPackage(cityId, recommendPlace) {
		return this.getData({
			url: '/car/package/recommend/list',
			method: "POST",
			data: {
				cityId: cityId,
				recommendPlace: recommendPlace
			}
		})
	}

	/* 汽车品牌列表 */
	BrandList(isRecommend) {
		return this.getData({
			url: '/car/brand/list',
			method: "POST",
			data: {
				isRecommend: isRecommend
			}
		})
	}

	/* 婚车套餐列表 */
	CarPackageList(cityId, brandId, orderNum) {
		return this.getData({
			url: '/car/package/list',
			method: "POST",
			data: {
				cityId: cityId,
				brandId: brandId,
				orderNum: orderNum
			}
		})
	}

	/* 婚车列表 */
	CarList(cityId, brandId, orderNum, levelId = '', colorId = '') {
		return this.getData({
			url: '/car/car/list',
			method: "POST",
			data: {
				cityId: cityId,
				brandId: brandId,
				orderNum: orderNum,
				levelId: levelId,
				colorId: colorId
			}
		})
	}

	/* 车颜色列表 */
	CarColorList() {
		return this.getData({
			url: '/car/color/list',
			method: "POST"
		})
	}

	/* 车级别列表 */
	CarLevelList() {
		return this.getData({
			url: '/car/level/list',
			method: "POST"
		})
	}

	/* 帮我选车 */
	HelpCart(data) {
		return this.getData({
			url: '/car/demand/selectcar/add',
			method: "POST",
			data: data
		})
	}

	/* 婚车详情 */
	CarInfo(id) {
		return this.getData({
			url: `/car/car/info/${id}`,
			method: "POST"
		})
	}

	/* 婚车套餐详情 */
	CarPackageInfo(id) {
		return this.getData({
			url: `/car/package/info/${id}`
		})
	}

	/* 加价规则 */
	AddPriceRule(data) {
		return this.getData({
			url: '/car/rule/page',
			method: "POST",
			data: data
		})
	}

	/* 加入购物车 */
	AddShopingCart(data) {
		return this.getData({
			url: '/car/cart/add',
			method: "POST",
			data: data
		})
	}

	/* 购物车列表 */
	ShopingCartList() {
		return this.getData({
			url: '/car/cart/list',
			method: "POST"
		})
	}

	/* 删除购物车 */
	ShopingCartListDel(data) {
		return this.getData({
			url: '/car/cart/del',
			method: "POST",
			data: data
		})
	}

	/* 商家列表 */
	StoreList(data) {
		return this.getData({
			url: '/bus/store/list',
			method: "POST",
			data: data
		})
	}

	/* 商家详细 */
	StoreInfo(data) {
		return this.getData({
			url: '/bus/store/info',
			method: "POST",
			data: data
		})
	}

	/* 文章列表 */
	NewsList(data) {
		return this.getData({
			url: '/forum/article/page',
			method: "POST",
			data: data
		})
	}

	/* 文章详细 */
	NewsInfo(id) {
		return this.getData({
			url: `/forum/article/info/${id}`
		})
	}

	/* 收藏 */
	Collect(data) {
		return this.getData({
			url: '/sys/collect/set',
			method: "POST",
			data: data
		})
	}

	/* 订单列表 */
	OrderList(data) {
		return this.getData({
			url: '/car/order/list',
			method: "POST",
			data: data
		})
	}

	/* 订单详情 */
	OrderInfo(id) {
		return this.getData({
			url: `/car/order/info/${id}`
		})
	}

	/* 下单 */
	OrderSubmit(data) {
		return this.getData({
			url: '/car/order/submit',
			method: "POST",
			data: data
		})
	}

	/* 获取系统参数 */
	GetParams(data) {
		return this.getData({
			url: '/sys/params/list',
			method: "POST",
			data: data
		})
	}

	/* 拉取消息 */
	MsgPull(data) {
		return this.getData({
			url: '/sys/msg/pull',
			method: "POST",
			data: data
		})
	}

	/* 发送消息 */
	MsgSend(data) {
		return this.getData({
			url: '/sys/msg/send',
			method: "POST",
			data: data
		})
	}

}

export default new HttpApi();

